function [DATA,HEX,location_real]=data_process2(filepath1_DATA,filepath1_HEX,filepath2_DATA,filepath2_HEX,filepath_locationReal,Area,time_a,time_b,interference_num,location_real,range)

%% 读取原始数据
data1=load(filepath1_DATA);
data2=load(filepath1_HEX);
DATA = data1.DATA;
HEX = data2.HEX;
% DATA(:,6)=DATA(:,5);
%% 时间范围选择a~b
for i=1:size(DATA,1)
    if DATA(i,6)==time_a
        break;
    end    
end
for j=1:size(DATA,1)
    if DATA(j,6)==time_b
        break;
    end    
end
DATA=DATA(i:j,:);
HEX=HEX(i:j,:);
%% 区域选择
if Area==1
    lat1=30;lat2=34;lon1=-99.5;lon2=-95.5;
end
if Area==2
    lat1=42;lat2=46;lon1=-116;lon2=-112;
end
if Area==3
    lat1=28;lat2=32;lon1=-101;lon2=-97;
end
%% 变换坐标，将所有数据变换成KM单位
DATA(:,7)=(DATA(:,1)-lon1).*(111*cos(DATA(:,2).*(pi/180)));
DATA(:,8)=(DATA(:,2)-lat1).*111;
%% 干扰源输入，干扰源数量：interference_num
%干扰源的KM坐标
Interf_KM=[];
Interf_KM(:,1)=(location_real(:,1)-lon1).*(111*cos(location_real(:,2).*(pi/180)));
Interf_KM(:,2)=(location_real(:,2)-lat1).*111;
%% 删除干扰范围内的数据，完成数据仿真
for i=1:interference_num
    DATA1=zeros(1,8);HEX1=strings();k=1;
    for j=1:1:size(DATA,1)
        if pdist([DATA(j,7:8);Interf_KM(i,1:2)])>range
            DATA1(k,:)=DATA(j,:);
            HEX1 (k,1)=HEX (j,1);
            k=k+1;
        end
    end
    DATA=DATA1;HEX=HEX1;
end
%% 存储数据
save(filepath2_DATA, 'DATA');
save(filepath2_HEX, 'HEX');
save(filepath_locationReal, 'location_real');
end